// components/solidSearch/solidSearch.js
let app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    /**
     * 城市名 
     * */
    cityName: {
      type: String,
      value: "成都"
    },
    labelHeight: {
      type: Number,
      value: 13
    }


  },

  /**
   * 组件的初始数据
   */
  data: {
    menuTop: app.globalData.menuButton.top,
    menuHeight: app.globalData.menuButton.height,
    showCityName: "",
  },

  lifetimes: {
    attached: function () {
      // 在组件实例进入页面节点树时执行
      if (this.properties.cityName) {
        this.setData({
          showCityName: this.properties.showCityName
        })
      }


    },
    detached: function () {

    },
  },
  observers: {
    'cityName': function (newValue) {
      this.setData({
        showCityName: newValue
      })
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    pushToSearchPage() {
      wx.navigateTo({
        url: '/firstPackage/pages/searchPage/searchPage',
      })
    },
    //测试获取手机号:
    getPhoneNumber(e) {
      console.log("JJLog:获取手机号返回:" + JSON.stringify(e));
    },
    //跳转到选择城市列表
    pushToSelectCity() {
      wx.navigateTo({
        url: '/firstPackage/pages/select_city/select_city',
      })
    },
  }
})
